package NarkyPackage;

import java.awt.Rectangle;

public class Bloque {
	
	private Rectangle rect;
	private char tipo;
	
	public Bloque(char tipo, int x, int y) {
		this.tipo = tipo;
		rect = new Rectangle (x*20, y*20, 20, 20);
	}
	
	public boolean hayPiso(Rectangle rect) {
		if (tipo == 'X')
			return this.rect.intersects(rect);
		return false;
	}

	public boolean hayEscalera(Rectangle rect) {
		if (tipo == 'M' || tipo == 'N')
			return this.rect.intersects(rect);
		return false;
	}
	
	public char getTipo() {
		return tipo;
	}

}
